package com.xianrenit.xianrenpuzi.sms.controller;

import com.xianrenit.xianrenpuzi.model.result.Result;
import com.xianrenit.xianrenpuzi.sms.service.SmsService;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/user/sms")
public class SmsController {
    @Resource
    SmsService smsService;
    @Operation(summary = "发送短信")//注册验证码 登录验证码
    @GetMapping("/sendCode/{phone}")
    public Result sendCode(@PathVariable("phone")String phone,
                           @RequestParam(value = "type" , required = false)Integer type){//获取type参数  用来判断发送短信的类型 默认发送注册验证码
        smsService.sendMsg(phone , type);
        return Result.ok();
    }

}
